package cn.arnold.offer.guanglianda.test1;

import java.util.Scanner;

/**
 * @Author Arnold
 * @Desc TODO
 **/
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s1 = scanner.nextLine();
        String s2 = scanner.nextLine();
        // WASDWWSAD
        // WASSWWAAD
        // 踩对方向加20分，踩错方向扣10分
        int score = 0;
        for (int i = 0; i < s1.length(); i++) {
            char c1 = s1.charAt(i);
            char c2 = s2.charAt(i);
            if (c1 == c2) {
                score += 20;
            } else {
                if (score != 0) {
                    score -= 10;
                }
            }
        }
        System.out.println(score);
    }
}
